// 通用组件封装

// 导入消息通知组件
import { ElNotification, ElMessageBox } from 'element-plus'
import nprogress from 'nprogress'

//通知框
export function toast(message, type = 'success', duration = 2000) {
    ElNotification({
        message,
        type,
        duration
    })
}

// 消息弹出框
export function showMessage(content = '提示的消息', type = 'warning', title = '') {
    return ElMessageBox.confirm(
        content,
        title,
        {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type,
        }
    )
}

// 显示全屏 loading
export function showFullLoading(){
    nprogress.start()
}
// 隐藏全屏 loading
export function hideFullLoading(){
    nprogress.done()
}